import unittest
import time
from BeautifulReport import BeautifulReport
from config.config import REPORT_PATH
from config.config import TESTCASE_PATH
nowtime = time.strftime("%Y%m%d%H%M%S")

#BeautifulReport
discover = unittest.defaultTestLoader.discover("../test_case","test_*.py")
file = open("../report/Ecshop-TestResult-{}.html".format(nowtime),"wb")
runner = BeautifulReport(discover)
runner.report(description="Ecshop测试用例执行结果",
              filename="Ecshop-TestResult-{}.html".format(nowtime),
              report_dir=REPORT_PATH)